import instance from './request'
import mockreq from './mockreq'


export const reqfree = () => instance.get('product/getBaseCategoryList')

export const requestsearch = (params) => instance.post('/list', params)

export const requestBanner = () => mockreq.get('/banner')

export const requestFloor = () => mockreq.get('/floor')

export const requestdetail = (skuid) => instance.get(`/item/${skuid}`, skuid)

export const requestgoods = (skuID, skuNum) => instance.post(`/cart/addToCart/${ skuID }/${ skuNum }`, { skuID, skuNum })

export const requestcars = () => instance.get('/cart/cartList')

export const requestcode = (phone) => instance.get(`/user/passport/sendCode/${phone}`, { phone })

export const requestregister = (phone, password, code) => instance.post(`/user/passport/register`, { phone, password, code })

export const requestlogin = (phone, password) => instance.post(`/user/passport/login`, { phone, password })


export const loginout = () => instance.get('/user/passport/logout')

export const token = () => instance.get('/user/passport/auth/getUserInfo')

export const removecars = (skuId) => instance.delete(`/cart/deleteCart/${skuId}`, { skuId })

export const addToCart = (skuId, skuNum) => instance.post(`/cart/addToCart/${ skuId }/${ skuNum }`, { skuId, skuNum })

export const trade = () => instance.get('/order/auth/trade')

export const findUserAddressList = () => instance.get('/user/userAddress/auth/findUserAddressList')